package org.neframework.webtest.action.xyk.card;

import java.util.List;
import java.util.Map;

import org.neframework.webtest.base.BaseController;
import org.neframework.webtest.service.CustomerAnysisService;
import org.neframework.webtest.service.CustomerService;

import com.tmsps.neframework.mvc.annotation.Controller;
import com.tmsps.neframework.mvc.annotation.RequestMapping;
import com.tmsps.neframework.mvc.annotation.ResponseBody;

@Controller
@RequestMapping("/cp/xyk/card/all")
public class CardAllController extends BaseController {

	private static final CustomerService custService = new CustomerService();
	private static final CustomerAnysisService anysisService = new CustomerAnysisService();

	@RequestMapping("/list")
	public String list() {

		return "/jsp/xyk/card/all/list.jsp";
	}

	@RequestMapping("/list_data")
	@ResponseBody
	public void list_data(String srh_name, String srh_card_no,
			String srh_bill_day, String srh_bill_back_day) {

		List<Map<String, Object>> list = custService.selectCardList(srh_name,
				srh_card_no, srh_bill_day, srh_bill_back_day, sort_params, page);

		for (Map<String, Object> map : list) {
			String customer_card_id = (String) map.get("kid");
			Map<String, Object> flowMap = anysisService.findFlowMap(
					customer_card_id, null);
			map.putAll(flowMap);
		}

		result.put("list", list);
	}

}
